__author__ = 'dsteil' import Tkinter class GUIExample: def __init__(self): self.__mainWindow = Tkinter.Tk() self.count = 0 self.up_button = Tkinter.Button(self.__mainWindow, text="Up", command = self.buttonClickedCountUp) self.down_button = Tkinter.Button(self.__mainWindow, text="Down", command = self.buttonClickedCountDown) self.reset_button = Tkinter.Button(self.__mainWindow, text="Reset", command = self.buttonClickedReset) self.count_label = Tkinter.Label(self.__mainWindow, text=0) self.up_button.pack() self.down_button.pack() self.reset_button.pack() self.count_label.pack() self.__mainWindow.mainloop() def buttonClickedCountUp(self): self.count += 1 self.count_label['text'] = self.count def buttonClickedCountDown(self): self.count -= 1 self.count_label['text'] = self.count def buttonClickedReset(self): self.count = 0 self.count_label['text'] = self.count gui_Example = GUIExample()